package handler

import (
	"car/domain/service"
	"car/domain/model"
	car "car/proto/car"
	"context"
	comm "gitee.com/www.fei.com/go_common"
)
type Car struct{
     CarDataService service.ICarDataService
}

func (c *Car)AddCar(ctx context.Context, form *car.CartForm, res *car.Response) (err error) {
	car :=&model.Car{}
	comm.SwapTo(form,car)
	car.ID, err = c.CarDataService.AddCar(car)
	res.Code=200
	res.Message="success cartId:"+ string(car.ID)
	return err
}
